﻿/* using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using System.Diagnostics;
using Microsoft.Xna.Framework.Design;

namespace NeedForSmash
{
    public static class FillBoundingBox
    {

        static VertexPositionColor[] nonIndexedCube = new VertexPositionColor[36];
        static BasicEffect effect;
        static VertexDeclaration decl;


        public static void RNDR(
             BoundingBox box,
             GraphicsDevice graphicsDevice,
             Matrix view,
             Matrix projection,
             Color colorx)
        {

            if (effect == null)
            {



                effect = new BasicEffect(graphicsDevice);
                effect.VertexColorEnabled = true;
                effect.LightingEnabled = false;

                decl = new VertexDeclaration(graphicsDevice, VertexPositionColor.VertexElements);

            }


            Vector3 MinV = box.Min;
            Vector3 MaxV = box.Max;

            Vector3 topLeftBack = new Vector3(MinV.X, MaxV.Y, MinV.Z);
            Vector3 topRightBack = new Vector3(MaxV.X, MaxV.Y, MinV.Z);
            Vector3 bottomLeftBack = new Vector3(MinV.X, MinV.Y, MinV.Z); //min  
            Vector3 bottomRightBack = new Vector3(MaxV.X, MinV.Y, MinV.Z);

            Vector3 topLeftFront = new Vector3(MinV.X, MaxV.Y, MaxV.Z);
            Vector3 topRightFront = new Vector3(MaxV.X, MaxV.Y, MaxV.Z);  //max    
            Vector3 bottomLeftFront = new Vector3(MinV.X, MinV.Y, MaxV.Z);
            Vector3 bottomRightFront = new Vector3(MaxV.X, MinV.Y, MaxV.Z);

            // Front face  
            nonIndexedCube[0] =
                new VertexPositionColor(topLeftFront, colorx);
            nonIndexedCube[1] =
                new VertexPositionColor(bottomLeftFront, colorx);
            nonIndexedCube[2] =
                new VertexPositionColor(topRightFront, colorx);

            nonIndexedCube[3] =
                new VertexPositionColor(bottomLeftFront, colorx);
            nonIndexedCube[4] =
                new VertexPositionColor(bottomRightFront, colorx);
            nonIndexedCube[5] =
                new VertexPositionColor(topRightFront, colorx);

            // Back face   
            nonIndexedCube[6] =
                new VertexPositionColor(topLeftBack, colorx);
            nonIndexedCube[7] =
                new VertexPositionColor(topRightBack, colorx);
            nonIndexedCube[8] =
                new VertexPositionColor(bottomLeftBack, colorx);
            nonIndexedCube[9] =
                new VertexPositionColor(bottomLeftBack, colorx);
            nonIndexedCube[10] =
                new VertexPositionColor(topRightBack, colorx);
            nonIndexedCube[11] =
                new VertexPositionColor(bottomRightBack, colorx);


            // Top face  
            nonIndexedCube[12] =
                new VertexPositionColor(topLeftFront, colorx);
            nonIndexedCube[13] =
                new VertexPositionColor(topRightBack, colorx);
            nonIndexedCube[14] =
                new VertexPositionColor(topLeftBack, colorx);
            nonIndexedCube[15] =
                new VertexPositionColor(topLeftFront, colorx);
            nonIndexedCube[16] =
                new VertexPositionColor(topRightFront, colorx);
            nonIndexedCube[17] =
                new VertexPositionColor(topRightBack, colorx);


            // Bottom face   
            nonIndexedCube[18] =
                new VertexPositionColor(bottomLeftFront, colorx);
            nonIndexedCube[19] =
                new VertexPositionColor(bottomLeftBack, colorx);
            nonIndexedCube[20] =
                new VertexPositionColor(bottomRightBack, colorx);
            nonIndexedCube[21] =
                new VertexPositionColor(bottomLeftFront, colorx);
            nonIndexedCube[22] =
                new VertexPositionColor(bottomRightBack, colorx);
            nonIndexedCube[23] =
                new VertexPositionColor(bottomRightFront, colorx);

            // Left face  
            nonIndexedCube[24] =
                new VertexPositionColor(topLeftFront, colorx);
            nonIndexedCube[25] =
                new VertexPositionColor(bottomLeftBack, colorx);
            nonIndexedCube[26] =
                new VertexPositionColor(bottomLeftFront, colorx);
            nonIndexedCube[27] =
                new VertexPositionColor(topLeftBack, colorx);
            nonIndexedCube[28] =
                new VertexPositionColor(bottomLeftBack, colorx);
            nonIndexedCube[29] =
                new VertexPositionColor(topLeftFront, colorx);

            // Right face   
            nonIndexedCube[30] =
                new VertexPositionColor(topRightFront, colorx);
            nonIndexedCube[31] =
                new VertexPositionColor(bottomRightFront, colorx);
            nonIndexedCube[32] =
                new VertexPositionColor(bottomRightBack, colorx);
            nonIndexedCube[33] =
                new VertexPositionColor(topRightBack, colorx);
            nonIndexedCube[34] =
                new VertexPositionColor(topRightFront, colorx);
            nonIndexedCube[35] =
                new VertexPositionColor(bottomRightBack, colorx);


            graphicsDevice.VertexDeclaration = decl;
            graphicsDevice.RenderState.CullMode = CullMode.None;

            graphicsDevice.RenderState.AlphaBlendEnable = true;
            graphicsDevice.RenderState.SourceBlend = Blend.SourceAlpha;
            graphicsDevice.RenderState.DestinationBlend = Blend.DestinationAlpha;

            effect.View = view;
            effect.Projection = projection;

            effect.Begin();

            foreach (EffectPass pass in effect.CurrentTechnique.Passes)
            {
                pass.Begin();

                graphicsDevice.DrawUserPrimitives<VertexPositionColor>
               (PrimitiveType.TriangleList, nonIndexedCube, 0, 12);

                pass.End();
            }
            effect.End();

        }

    }
} */
